(function () {
    const oEchart = echarts.init(document.getElementById('gradient01'));
    // console.log(echarts.graphic.LinearGradient, '渐变函数')
    oEchart.setOption({
        xAxis: { //坐标轴设置
            type: 'category', //类型，category类目型，必须通过data设置类目数据
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            // position: 'top' //设置坐标轴位置
        },
        yAxis: { //坐标轴设置
            type: 'value' //类型,value数值型,默认会自动从目标数据中读取数据
        },
        series: [
            {
                data: [820, 932, 901, 934, 1290, 1330, 1320],
                type: 'bar',
                name: '数量1',
                itemStyle: {
                    color: {
                        type: 'linear', //线性渐变
                        x: 0,
                        y: 0,
                        x2: 0,
                        y2: 1,
                        colorStops: [
                            { offset: 0, color: '#41CAFA' },
                            { offset: 1, color: '#FFB301' }
                        ]
                    },
                    // color: {
                    //     type: 'radial', //经向渐变
                    //     x: 0.5,
                    //     y: 0.5,
                    //     r: 0.5,
                    //     colorStops: [
                    //         { offset: 0, color: '#41CAFA' },
                    //         { offset: 1, color: '#FFB301' }
                    //     ]
                    // }
                }
            }
        ]
    })
})()